home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 2
/
AACD 2.iso
/
AACD
/
WebSites
/
Sites
/
Amigactive
/
images
/
menu
/
MakeNavBar.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-05-02
|
2KB
|
66 lines
/* Generates an imagemap from a set of discrete images */
options results
address command
parse arg ImageList
if ImageList = '' then ImageList = 'home.gif issues.gif cds.gif subs.gif surveys.gif'
MapFile = 'NavBar.map'
TempDir = 'T:MakeNavBar'
drop Images. ImageRoot. ImageExt. Width. Height.
if ~exists(Tempdir) then 'MakeDir >NIL:' Tempdir
i = 0
Images.i = 'logo.gif'
Images.1 = 'curve.gif'
i = 2
do while ImageList > ''
parse var ImageList Images.i ImageList
i = i + 1
end
Images.i = 'tailend.gif'
Images.Count = i
Width.Total = 0
Height.Total = 0
do i = 0 to Images.Count
parse var Images.i ImageRoot.i '.' ImageExt.i
select
when upper(ImageExt.i) = 'GIF' then 'giftopnm images/'Images.i' >'AddPart(TempDir,ImageRoot.i'.ppm')
otherwise nop
end
'pnmfile' AddPart(TempDir,ImageRoot.i'.ppm') '>ENV:MakeNavBar'
tmp = GetVar('MakeNavBar')
parse var tmp x 'raw, ' Width.i ' by ' Height.i ' ' .
Width.Total = max(Width.total,Width.i)
Height.Total = Height.Total + Height.i
end
call open(out,MapFile,'W')
call writeln(out,'<map name="NavBar">')
'ppmmake white' Width.Total Height.Total '>'AddPart(TempDir,'NavMap.ppm')
Top = 0
do i = 0 to Images.Count
'pnmcomp -x 0 -y 'Top AddPart(TempDir,ImageRoot.i'.ppm') AddPart(TempDir,'NavMap.ppm') '>'AddPart(TempDir,'NavMap1.ppm')
call delete(AddPart(TempDir,'NavMap.ppm'))
call rename(AddPart(TempDir,'NavMap1.ppm'),AddPart(TempDir,'NavMap.ppm'))
select
when i = 0 then call writeln(out,'<area shape="rect" coords="0,'Top','Width.i','Top + Height.i'" href="main.html" target="f_main" alt="'ImageRoot.i'">')
when i = 1 then nop
when i = Images.Count then nop
otherwise call writeln(out,'<area shape="rect" coords="0,'Top','Width.i','Top + Height.i'" href="'ImageRoot.i'/'ImageRoot.i'_menubar.html" target="f_title" alt="'ImageRoot.i'">')
end
Top = Top + Height.i
end
call writeln(out,'</map>')
call close(out)
'ppmquant 256' AddPart(TempDir,'NavMap.ppm') '>'AddPart(TempDir,'NavMap1.ppm')
'ppmtogif -transparent white -interlace' AddPart(TempDir,'NavMap1.ppm') '>images/navmap.gif'
'delete >NIL:' TempDir 'all force'
exit